using System;
using System.Data;
using System.Collections.Generic;
using System.Collections;
using log4net;
using FSS.BLL.Entities;
namespace FSS.BLL.Services
{
	#region UserService

	/// <summary>
	/// UserService object for Ibatis mapped table 'User'.
	/// </summary>
	public class UserService : IUserService
	{
		private static readonly ILog log = LogManager.GetLogger(typeof(UserService).Name);
	  	private static volatile UserService _UserService = null;
        public static UserService GetInstance()
        {
            if (_UserService == null)
            {
                lock (typeof(UserService))
                {
                    if (_UserService == null) // double-check
                        _UserService = new UserService();
                }
            }
            return _UserService;
        }
		public UserService()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public UserEntity LoadByEmployeeId(UserEntity objE)
        {
            try
            {
                return ExecuteQueryForObject<UserEntity>("UserLoadByEmployeeId", objE);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
        public IList<UserEntity> LoadAllExtra()
        {
            try
            {
                return ExecuteQueryForList<UserEntity>("UserLoadAllExtra", null);
            }
            catch (Exception ex)
            {
                log.Debug(ex.Message);
                return null;
            }
        }
	}
	#endregion  
}
